<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<div><span>John</span> Resig</div>

<div>George Martin</div>
<div><b>Malcom <i>John</i> Sinclair</b></div>
<div>J. Ohn</div>


<script>
$("div:contains('John')").css("text-decoration", "underline");
    </script>

</body>
</html>